

.LC0:
	.string "窗口演示"

.LC1:
	.string "delete_event"

.LC2:
	.string "连接服务器"

.LC3:
	.string "clicked"

.LC4:
	.string "提示消息"

.LC5:
	.string "连接失败!"


.globl main

main:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp

	movl %edi,-0x1000(%rbp) /* argc */
	movq %rsi,-0xff8(%rbp) /* argv */
	movq $0,-0xff0(%rbp) /* */
	movq $0,-0xfe8(%rbp) /* window */
	movq $0,-0xfe0(%rbp) /* table */
	movq $0,-0xfd8(%rbp) /* but1 */
	movq $0,-0xfd0(%rbp) /* vbox */

	leaq -0xff8(%rbp),%rsi /* argv */
	leaq -0x1000(%rbp),%rdi /* argc */
	call gtk_init 

	movl $1,%edx
	movl $2,%esi 
	movl $2,%edi 
	call gtk_table_new 
	movq %rax,-0xfe0(%rbp) /* table */

	movl $0,%edi
	call gtk_window_new 
	movq %rax,-0xfe8(%rbp) /* window */

	call gtk_window_get_type 
	movq %rax,%rsi
	movq -0xfe8(%rbp),%rdi /* window */
	call g_type_check_instance_cast 
	leaq .LC0(%rip),%rsi
	movq %rax,%rdi
	call gtk_window_set_title

	movl $80,%esi
	movq -0xfe8(%rbp),%rdi /* window */
	call g_type_check_instance_cast 
	movl $0,%r9d
	movl $0,%r8d 
	movl $0,%ecx 
	movq gtk_main_quit@GOTPCREL(%rip),%rdx
	leaq .LC1(%rip),%rsi
	movq %rax,%rdi
	call g_signal_connect_data 

	call gtk_container_get_type
	movq %rax,%rsi
	movq -0xfe8(%rbp),%rdi /* window */
	call g_type_check_instance_cast 
	movl $10,%esi
	movq %rax,%rdi 
	movl $0,%eax
	call gtk_container_set_border_width 

	movl $8,%esi
	movl $0,%edi 
	call gtk_vbox_new 
	movq %rax,-0xfd0(%rbp) /* vbox */

	leaq .LC2(%rip),%rdi
	call gtk_button_new_with_label 
	movq %rax,-0xfd8(%rbp) /* but1 */

	call gtk_box_get_type
	movq %rax,%rsi
	movq -0xfd0(%rbp),%rdi /* vbox */
	call g_type_check_instance_cast 
	movl $5,%r8d
	movl $1,%ecx 
	movl $1,%edx 
	movq -0xfd8(%rbp),%rsi /* but1  */
	movq %rax,%rdi
	call gtk_box_pack_start 

	movl $0,%r9d
	movl $0,%r8d
	movq $0,%rcx /* entry */
	leaq fun(%rip),%rdx 
	leaq .LC3(%rip),%rsi
	movq -0xfd8(%rbp),%rdi /* but1 */
	call g_signal_connect_data 

	call gtk_container_get_type 
	movq %rax,%rsi 
	movq -0xfe8(%rbp),%rdi /* window */
	call g_type_check_instance_cast 

	movq -0xfd0(%rbp),%rsi /* vbox */
	movq %rax,%rdi
	call gtk_container_add 


	movq -0xfe8(%rbp),%rdi /* window */
	call gtk_widget_show_all
	call gtk_main 
	movl $0,%eax
	leave
	ret

fun:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp

	movq $0,-0x1000(%rbp) /* dialog */

	leaq .LC5(%rip),%r8 
	movl $1,%ecx
	movl $0,%edx 
	movl $2,%esi 
	movl $0,%edi 
	call gtk_message_dialog_new 
	movq %rax,-0x1000(%rbp) /* dialog */

	call gtk_window_get_type
	movq %rax,%rsi
	movq -0x1000(%rbp),%rdi /* dialog */
	call g_type_check_instance_cast 
	leaq .LC4(%rip),%rsi 
	movq %rax,%rdi 
	call gtk_window_set_title

	call gtk_dialog_get_type 
	movq %rax,%rsi 
	movq -0x1000(%rbp),%rdi /* dialog */
	call g_type_check_instance_cast
	movq %rax,%rdi
	call gtk_dialog_run 

	movq -0x1000(%rbp),%rdi /* dialog */
	call gtk_widget_destroy 

	movl $0,%eax
	leave
	ret
